<?php

declare(strict_types=1);

namespace App\Request\Client\Login;


use App\Constants\Regex;
use Hyperf\Validation\Request\FormRequest;

class RegisterUseWxRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'phone' => [
                'required',
                'regex:' . Regex::PHONE
            ],
            'code' => 'required',
            'openid' => 'required'
        ];
    }

    public function messages(): array
    {
        return [
            'phone.regex' => 'phone ' . Regex::PHONE_MESSAGE
        ];
    }

}